'''
定义了一个学生类：属性:学号，姓名，年龄，性别，身高，体重，成绩，家庭地址，电话号码。
行为：学习（要求参数传入学习的时间），玩游戏（要求参数传入游戏名），编程（要求参数传入写代码的行数），数的求和（要求参数用变长参数来做，返回求和结果）
'''

class Student:
    def __init__(self,id,name,age,sex,high,weigh,grade,address,number):
        self.id = id
        self.name = name
        self.age = age
        self.sex = sex
        self.high = high
        self.weigh = weigh
        self.grade = grade
        self.address = address
        self.number = number

    def Study(self,time):
        print('学习时间：{}'.format(time))

    def Play(self,game):
        print('游戏名称：{}'.format(game))

    def Complex(self,num):
        print('写{}行代码'.format(num))

    def Sum(self,*args):
        total = sum(args)
        print('求和{}'.format(total))
        return total

s = Student(
    id = '001',
    name = 'Lucy',
    age = 20,
    sex = 'female',
    high = '168cm',
    weigh = '110 g',
    grade = '优秀',
    address = '河南',
    number = '1234567890'
                               )
s.Study(2)
s.Play('暖暖')
s.Complex(100)
s.Sum(1,2,3,4,5)

'''
车类：属性：车型号，车轮数，车身颜色，车重量，油箱存储大小 。功能：跑（要求参数传入车的具体功能，比如越野，赛车）
创建：法拉利，宝马，铃木，五菱，拖拉机对象
'''

class Car:
    def __init__(self,type,num,color,weigh,size):
        self.type = type
        self.num = num
        self.color = color
        self.weigh = weigh
        self.size = size

    def Run(self,funtion):
        print('{}功能是：{}'.format(self.type,funtion))

Ferrari = Car(
    type = 'Ferrari 575M',
    num = '4',
    color = 'red',
    weigh='1.73t',
    size='78L'
)

BMW = Car(
    type='BMW X6',
    num='4',
    color='black',
    weigh='2200 kg',
    size='85L'
)

Suzuki = Car(
    type='UY125',
    num='4',
    color='white',
    weigh='112 kg',
    size='5.5L'
)

SGMW = Car(
    type='SGMW S3',
    num='4',
    color='white',
    weigh='1030 kg',
    size='40L'
)

Tractors = Car(
    type='6J-1654',
    num='4',
    color='yellow',
    weigh='1300 kg',
    size='372L'
)

Ferrari.Run('赛车')


'''
笔记本：属性：型号，待机时间，颜色，重量，cpu型号，内存大小，硬盘大小。  
行为：打游戏（传入游戏的名称）,办公。
'''
class Notebook:
    def  __init__(self,type,time,color,weigh,cpu,memory,disk):
        self.type = type
        self.time = time,
        self.color = color,
        self.weigh = weigh,
        self.cpu = cpu,
        self.memory = memory,
        self.disk = disk

    def Play(self,name):
        print('{}游戏名称：{}'.format(self.type,name))

    def Office(self):
        print('办公')

Apple = Notebook(
    type = 'apple',
    time = '180 min',
    color = 'pink',
    weigh=10,
    cpu='A18',
    memory='512G',
    disk = '20'
)

Apple.Play('暖暖')
Apple.Office()

'''
猴子类：属性：类别，性别，身体颜色，体重。
行为：造火（要求传入造火的材料：比如木棍还是石头），学习事物（要求参数传入学习的具体事物，可以不止学习一种事物）
'''
class Monkey:
    def __init__(self,type,sex,color,weigh):
        self.type = type
        self.sex = sex
        self.color = color
        self.weigh = weigh

    def Fire(self,materials):
        print('{}使用造火的材料:{}'.format(self.type,materials))

    def Study(self,things):
        print('{}学习了{}'.format(self.type,things))

m = Monkey(
    type = 'golden monkey',
    sex = '雌性',
    color='golden',
    weigh=60
)

m.Fire('石头')
m.Study('使用工具')